package top.haijunit.work.modules.mall.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import top.haijunit.work.core.doamin.TreeNode;

/**
 * 【说明类功能】
 *
 * @author zhanghaijun
 * @since 2024-08-23
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@JsonIgnoreProperties({"id", "parentId"})
public class CityInfo extends TreeNode<CityInfo, Long> {

    @Schema(description = "唯一标识", example = "110100")
    private Long uniqCode;
    @Schema(description = "城市名称", example = "北京市")
    private String name;
    @Schema(description = "父级code", example = "110000")
    private Long parentCode;
    @Schema(description = "城市等级，1国家 2省 3市 4区", example = "3")
    private Integer level;
    @Schema(description = "邮政编码", example = "100000")
    private String postal;
    @Schema(description = "全称-编码", example = "china.110000.110100")
    private String fullCode;
    @Schema(description = "全称-名称", example = "北京市.北京市")
    private String fullName;

    @Override
    public Long getId() {
        return this.getUniqCode();
    }

    @Override
    public Long getParentId() {
        return this.getParentCode();
    }
}
